﻿using QLInternet.Connection;
using QLInternet.Source;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace QLInternet.Model
{
    class PhuongThuc
    {
        private int maPT;
        private int moiMB;
        private int cuocToiDa;
        private int denMB;
        private int donGia;
        public Connect conn = new Connect("localhost", "internet", "root", "");

        public int MaPT
        {
            get { return maPT; }
            set { maPT = value; }
        }
        public int MoiMB
        {
            get { return moiMB; }
            set { moiMB = value; }
        }
        public int CuocToiDa
        {
            get { return cuocToiDa; }
            set { cuocToiDa = value; }
        }
        public int DenMB
        {
            get { return denMB; }
            set { denMB = value; }
        }
        public int DonGia
        {
            get { return donGia; }
            set { donGia = value; }
        }

        public void setConnect(Connect c)
        {
            conn = c;
        }
        public QuanLy qL;

        public PhuongThuc()
        {
            qL = new QuanLy();
        }
        public ObservableCollection<PhuongThuc> getDSPhuongThuc()
        {
            if (!conn.IsOpenning)
                conn.getConnect();
            return qL.loadDSPhuongThuc(conn);
            
        }

    }
}
